﻿using System;
using System.Threading;
namespace ID_card
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {

            Console.WriteLine("\n\n某某年的某某天，某人开了某些卡.....故事由此开始了..................\n");

            Thread.Sleep(1500);
            
            //初始化信用卡和储蓄卡
            CreditCard c0 = new CreditCard();
            Save_card c1 = new card01(500);
            Save_card c2 = new card02(1500);

            User user = new User();
            user.AddCard(c0);
            Thread.Sleep(1500);
            user.AddCard(c1);
            Thread.Sleep(1500);
            user.AddCard(c2);


            Thread.Sleep(1500);
            Console.WriteLine("----------------------------------------------------");
            Thread.Sleep(1500);
            Console.WriteLine("\n\n某某年的某某天，某人开了因为开了某张卡.....故事由此开始了..................\n");
            Thread.Sleep(1500);

            CreditCardDelegate objcreditCardDelegate = new CreditCardDelegate();

            objcreditCardDelegate.NotifyMoneyWarnning += new CreditCardDelegate.CardDelegate(user.payMoney);

            //用户消费
            user.ccard.CreditCardPay(1500);
            Thread.Sleep(1500);
            objcreditCardDelegate.Notify(user.num);
            Thread.Sleep(1500);

            Console.WriteLine("\n抹抹眼泪：还款吧！\n");

            Thread.Sleep(1500);

            Console.WriteLine("\n请选择卡还款：\n");
            String cardString = Console.ReadLine();
            int cardnum = Convert.ToInt32(cardString);
            Thread.Sleep(1500);
            user.scard[cardnum-1].backMoney(c0);
            Thread.Sleep(1500);

            Console.ReadLine();

        }
    }
}
